<link href="__PUBLIC__/etc/zui/docs/css/zui.min.css" rel="stylesheet">
<link href="__PUBLIC__/etc/zui/docs/css/doc.min.css" rel="stylesheet">
<style id="themeStyle"></style>

<link rel="shortcut icon" href="__PUBLIC__/etc/zui/favicon.ico" type="image/x-icon">
<link rel="icon" href="__PUBLIC__/etc/zui/favicon.ico" type="image/x-icon">

<!--[if lt IE 9]>
<script src="dist/lib/ieonly/html5shiv.js"></script>
<script src="dist/lib/ieonly/respond.js"></script>
<script src="dist/lib/ieonly/excanvas.js"></script>
<![endif]-->
<script src="__PUBLIC__/etc/jquery.js"></script>
<script type='text/javascript' src='__PUBLIC__/etc/cmn/cmn.js'></script>
<link href="__PUBLIC__/etc/cmn/cmn.css" rel="stylesheet">
<script>var __app__='__APP__';var __url__='__URL__';var __public__='__PUBLIC__';</script>

<!-- head包usr.js -->
<script type="text/javascript" src='__PUBLIC__/JS/admin/usrhd.js'></script>

<script type="text/javascript">
var dologinout='__APP__/Usr/dologinout';
var dotransfer='__APP__/Tool/dotransfer';
</script>
<header class="navbar navbar-fixed-top navbar-inverse" id='divhd' style='margin-bottom: 0px;' style='background-color:#333'>
  <div style='padding-left: 20px;padding-right: 20px'>
    <div class="navbar-header" >
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="__ROOT__/index.php" class="navbar-brand">★管理系统后台</a>
    </div>
    <nav class="collapse navbar-collapse bs-navbar-collapse"  style='background-color:#333'>
      <ul class="nav navbar-nav navbar-right">
					
					
			<?php if(session('usridss')){ ?>
					<!--
					{$ntfstr}
					<li>
					<script>var hdlatcsrc='__APP__/Atc/search/atckw/';</script>
					<script type="text/javascript" src='__PUBLIC__/JS/admin/atchd.js'></script>
					    <form class="navbar-form navbar-left">
						  <div class="input-group">
						      <input type="text" class="form-control" placeholder="搜索相应的内容" id='atckw'>
						      <span class="input-group-btn">
						        <button class="btn btn-primary" type="button" id='atc_search'>Search</button>
						      </span>
						    </div>
						</form>
					    
					</li>
					-->
					<?php if($usross['usrmk']==1){ ?>
					<div class="navbar-form navbar-left" role="search">
						<button id='h5occur' class="btn btn-default">H5翻译</button>
					</div>
					<div class="navbar-form navbar-left" role="search">
						<div class="form-group">
						  <input type="text" class="form-control" placeholder="加密链接" id="enclink">
						</div>
						<button id='transfer' class="btn btn-default">转换</button>
					</div>
					<?php } ?>
					
					
					<li class="dropdown">
						
						<a data-toggle="dropdown" class="dropdown-toggle " href="#">
							<img class='img-circle' src="{$usross['usrpt']}" style='width:20px;height:20px'/> {$usross['usrnn']}【{$usross['rlnms']}】 <b class="caret"></b>							
						</a>
						
						<ul class="dropdown-menu">
							<li>
								<a href='__APP__/Usr/usrct' ><i class="icon-user"></i> 个人中心  </a>
							</li>
							
							<li>
								<a href="__APP__/Usr/usrmdfpw"><i class="icon-lock"></i> 更改密码</a>
							</li>
							
							<li class="divider"></li>
							
							<li>
								<a href="#" id='usr_loginout'><i class="icon-off"></i> 注销 </a>
							</li>
						</ul>
					</li>
					<!--
					<li>
						<?php if($usross['usrid']==1||$usross['f_usr_sttid']==1){ ?><a href="__APP__/Atc/neiwang"><i class='glyphicon glyphicon-file'></i> 查看内网文章 </a><?php } ?>
					</li>
					<li>
						<a href="__APP__/Atc/collect"><i class='glyphicon glyphicon-heart'></i> 我的收藏 </a>
					</li>
					-->
					<li>
						<a class='cursorpoint' onclick='history.go(-1)'><i class='icon-caret-left'></i> 返回</a>
					</li>
					<li>
						<a href="__APP__"><i class='icon-home'></i> 主页 </a>
					</li>
					<li>
						<a class='cursorpoint' onclick='window.location.reload()'><i class='icon-refresh'></i> 刷新</a>
					</li>

			<?php }else{ ?>
				
				<li>
					<a href="__APP__"> 主页  </a>
				</li>
		
			<?php } ?>
			<li>
				<a id='qrcode' data-toggle="popover" data-placement="bottom" data-html="true"  data-content="" title="二维码" class='cursorpoint'><i class="icon icon-qrcode"></i></a>
				
			</li>
			<li>
				<a id='slink' data-toggle="popover" data-placement="bottom" data-html="true"  data-content="" title="短链接" class='cursorpoint'><i class="icon icon-link"></i></a>
				<div id='slinkTxt' style="position:fixed;left:0px;top:0px;color:transparent;"></div>
				<button class='btn btn-primary btn-sm' data-clipboard-action='copy' data-clipboard-target='#slinkTxt' id='trueheadclip' style="display:none">复制</button>
			</li>
			
			<li>
				<a id='time1'></a>
			</li>
			
		</ul>
    </nav>
  </div>
</header>

<script type="text/javascript" src="__PUBLIC__/etc/clipboard/dist/clipboard.min.js"></script>
 <script>

var clipboardhead = new Clipboard('#trueheadclip');

clipboardhead.on('success', function(e) {
    // msg('复制成功');
    $('#slink').popover('hide');
    console.log(e);
});

clipboardhead.on('error', function(e) {
    console.log(e);
});
</script>
<script>

function triggerTrueClip(){
	$('#trueheadclip').trigger('click');
}

$(function(){

	//header背景颜色
	$('header').css('background-color','#333');

	var url=window.location.href;
	// $('#slink').popover('hide');//先hide一下不然要点两次才会出来
	var slinkovertime=0;
	$('#slink').mouseover(function(){
		slinkovertime++;
		if(slinkovertime>1){return;}
		$.ajax({
            'type': 'GET',
            'url': "__APP__/Tool/shortlink",
            'async':false,  
            'contentType': 'application/json',
            'data': {'url':url},
            'dataType': 'json',
            'success': function(data) {
            	
            	$('#slink').attr('data-content',"<div style='width:200px'>"+data['slink']+"&nbsp;&nbsp;&nbsp;<button class='btn btn-info btn-mini' onclick='triggerTrueClip()'>复制</button>"+'</div>');
				$('#slinkTxt').html(data['slink']);
             	// $('#slink').popover();
                console.log("success");
            },
            'error':function() {

                console.log("error");
            }
        });
// $(this).popover();
		
		
	})

	var qrovertime=0;
	$('#qrcode').mouseover(function(){
		qrovertime++;
		if(qrovertime>1){return;}
		$.ajax({
            'type': 'GET',
            'url': "__APP__/Tool/qrcode",
            'async':false,  
            'contentType': 'application/json',
            'data': {'url':url},
            'dataType': 'json',
            'success': function(data) {

            	$('#qrcode').attr('data-content',"<div style='width:200px'><img src='data:image/png;base64,"+data['img']+"'></div>");
            	
                console.log("success");
            },
            'error':function() {

                console.log("error");
            }
        });
// $(this).popover();
		
		
	})
	

	$('#usr_loginout').click(function(){
		$.ajax({
            'type': 'GET',
            'url': dologinout,
            'async':false,  
            'contentType': 'application/json',
            'data': {},
            'dataType': 'json',
            'success': function(data) {
            	window.location.href='__APP__';
             
                console.log("success");
            },
            'error':function() {
                console.log("error");
            }
        });
	})
})
</script>
<script>
    function webClock(){
		var dNow=new Date();
		var dHours=dNow.getHours();
		var dMinutes=dNow.getMinutes();
		var dSeconds=dNow.getSeconds();
		webTime=((dHours<10) ? "0" : "")+dHours;
		webTime+=((dMinutes<10) ? ":0" : ":")+dMinutes;
		webTime+=((dSeconds<10) ? ":0" : ":")+dSeconds;
		var dDate=dNow.getDate();
		var dMonth=dNow.getMonth() + 1;
		var dYear=dNow.getFullYear();
		webDate=dYear;
		webDate+="/"+dMonth;
		webDate+=((dDate<10) ? "/0" : "/")+dDate;
		
		$('#time1').html(webDate+' '+webTime);
		setTimeout("webClock()",1000);
	}
	webClock();
</script>
<script type="text/javascript">
$(function(){
	$('#transfer').click(function(){
		var obj=new Object();
		obj['enclink']=$('#enclink').val();
		$.ajax({
            'type': 'GET',
            'url': dotransfer,
            'async':false,  
            'contentType': 'application/json',
            'data': obj,
            'dataType': 'json',
            'success': function(data) {
            	new $.zui.Messager(data['html'], {
			        icon: 'bell' // 定义消息图标
			        ,time:0
			    }).show();
             
                console.log("success");
            },
            'error':function() {
                console.log("error");
            }
        });
	})
})
</script>

<!--#################-->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal_h5occur" style='display:none' id='modal_h5occur'>
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal" id="myModal_h5occur" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
      <button type="button" class="close close_h5occur" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" id='close_h5occur'>&times;</span></button>
      <h4 class="modal-title">填入对应的H5代码</h4>
    </div>
      <div class="modal-body">
        <textarea class="form-control" id='h5code'></textarea>
        
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-success" id='doh5trans'  >点击转化</button>
        
      </div>
    </div>
  </div>
</div>
<script>
$(function(){
	$('#h5occur').click(function(){
		$('#modal_h5occur').trigger('click');
	})
	$('#doh5trans').click(function(){
		$('#close_h5occur').trigger('click');
		msg($('#h5code').val());
	})
})
</script>